#include "string.h"

void test1()
{
	bit::string s1;
	cout << s1.c_str() << endl;

	bit::string s2("hello world");
	cout << s2.c_str() << endl;

	for (int i = 0; i < s2.size(); i++)
	{
		s2[i] = 'x';
		cout << s2[i];
	}
	cout << endl;

	bit::string s3("having a good day!");
	bit::string::iterator it1 = s3.begin();
	while (it1 != s3.end())
	{
		cout << *it1 << " ";
		it1++;
	}
	cout << endl;
}

void test2()
{
	bit::string s1("hello world");
	cout << s1.c_str() << endl;

	s1 += ' ';
	s1 += " hello !";
	cout << s1.c_str() << endl;
}

void test3()
{
	bit::string s1("hello world!");
	cout << s1.c_str() << endl;

	s1.insert(6,'x');
	cout << s1.c_str() << endl;

	s1.insert(8, "xxxxxxxxx");
	cout << s1.c_str() << endl;

	s1.erase(6, 20);
	cout << s1.c_str() << endl;


}

void test4()
{
	bit::string s1("hello world");
	cout << s1.find(' ') << endl;
	cout << s1.find("rld") << endl;
}
int main()
{
	test4();
	return 0;
}